home *** CD-ROM | disk | FTP | other *** search
/ Motor Sport Digital Archive Collection 1960s / Motor Sport Digital Archive Collection 1960s.iso / main.swf / scripts / views / CoverThumb.as < prev    next >
Encoding:
Text File  |  2008-05-21  |  9.5 KB  |  311 lines

  1. package views
  2. {
  3.    import flash.accessibility.*;
  4.    import flash.debugger.*;
  5.    import flash.display.*;
  6.    import flash.errors.*;
  7.    import flash.events.*;
  8.    import flash.external.*;
  9.    import flash.filters.*;
  10.    import flash.geom.*;
  11.    import flash.media.*;
  12.    import flash.net.*;
  13.    import flash.printing.*;
  14.    import flash.profiler.*;
  15.    import flash.system.*;
  16.    import flash.text.*;
  17.    import flash.ui.*;
  18.    import flash.utils.*;
  19.    import flash.xml.*;
  20.    import mx.binding.*;
  21.    import mx.containers.Canvas;
  22.    import mx.controls.Image;
  23.    import mx.controls.Label;
  24.    import mx.core.UIComponentDescriptor;
  25.    import mx.core.mx_internal;
  26.    import mx.events.PropertyChangeEvent;
  27.    import mx.styles.*;
  28.    
  29.    public class CoverThumb extends Canvas
  30.    {
  31.       private static var _watcherSetupUtil:IWatcherSetupUtil;
  32.       
  33.       private var _bindings:Array;
  34.       
  35.       [Bindable]
  36.       private var _1916495839imgFile:String;
  37.       
  38.       private var btnDate:Class;
  39.       
  40.       public var _bindingsByDestination:Object;
  41.       
  42.       [Bindable]
  43.       private var _607087478_Image2:Image;
  44.       
  45.       [Bindable]
  46.       private var _1959266596labelTxt:String;
  47.       
  48.       public var _bindingsBeginWithWord:Object;
  49.       
  50.       private var _embed_mxml____embedded_assets_cover_drop_shadow_png_247875701:Class;
  51.       
  52.       [Bindable]
  53.       private var _681920764_Label1:Label;
  54.       
  55.       [Bindable]
  56.       private var _681210700highlight:Image;
  57.       
  58.       private var _watchers:Array;
  59.       
  60.       private var _documentDescriptor_:UIComponentDescriptor;
  61.       
  62.       public function CoverThumb()
  63.       {
  64.          _documentDescriptor_ = new UIComponentDescriptor({
  65.             "type":Canvas,
  66.             "propertiesFactory":function():Object
  67.             {
  68.                return {
  69.                   "width":77,
  70.                   "height":118,
  71.                   "childDescriptors":[new UIComponentDescriptor({
  72.                      "type":Image,
  73.                      "propertiesFactory":function():Object
  74.                      {
  75.                         return {"source":_embed_mxml____embedded_assets_cover_drop_shadow_png_247875701};
  76.                      }
  77.                   }),new UIComponentDescriptor({
  78.                      "type":Image,
  79.                      "id":"_Image2",
  80.                      "propertiesFactory":function():Object
  81.                      {
  82.                         return {
  83.                            "buttonMode":true,
  84.                            "width":69,
  85.                            "height":90
  86.                         };
  87.                      }
  88.                   }),new UIComponentDescriptor({
  89.                      "type":Image,
  90.                      "id":"highlight",
  91.                      "propertiesFactory":function():Object
  92.                      {
  93.                         return {
  94.                            "visible":false,
  95.                            "y":96,
  96.                            "width":69,
  97.                            "height":30
  98.                         };
  99.                      }
  100.                   }),new UIComponentDescriptor({
  101.                      "type":Label,
  102.                      "id":"_Label1",
  103.                      "stylesFactory":function():void
  104.                      {
  105.                         this.textAlign = "center";
  106.                      },
  107.                      "propertiesFactory":function():Object
  108.                      {
  109.                         return {
  110.                            "buttonMode":true,
  111.                            "width":70,
  112.                            "height":22,
  113.                            "y":96
  114.                         };
  115.                      }
  116.                   })]
  117.                };
  118.             }
  119.          });
  120.          btnDate = CoverThumb_btnDate;
  121.          _embed_mxml____embedded_assets_cover_drop_shadow_png_247875701 = CoverThumb__embed_mxml____embedded_assets_cover_drop_shadow_png_247875701;
  122.          super();
  123.          mx_internal::_document = this;
  124.          this.width = 77;
  125.          this.height = 118;
  126.          this.horizontalScrollPolicy = "off";
  127.          this.verticalScrollPolicy = "off";
  128.          this.addEventListener("rollOver",___Canvas1_rollOver);
  129.          this.addEventListener("rollOut",___Canvas1_rollOut);
  130.       }
  131.       
  132.       public static function set watcherSetupUtil(param1:IWatcherSetupUtil) : void
  133.       {
  134.          CoverThumb._watcherSetupUtil = param1;
  135.       }
  136.       
  137.       private function _CoverThumb_bindingsSetup() : void
  138.       {
  139.          var binding:Binding = null;
  140.          if(!_bindings)
  141.          {
  142.             _bindings = [];
  143.          }
  144.          if(!_watchers)
  145.          {
  146.             _watchers = [];
  147.          }
  148.          binding = new Binding(this,function():Object
  149.          {
  150.             return "images/thumbs/" + imgFile;
  151.          },function(param1:Object):void
  152.          {
  153.             _Image2.source = param1;
  154.          },"_Image2.source");
  155.          _bindings[0] = binding;
  156.          binding = new Binding(this,function():Object
  157.          {
  158.             return btnDate;
  159.          },function(param1:Object):void
  160.          {
  161.             highlight.source = param1;
  162.          },"highlight.source");
  163.          _bindings[1] = binding;
  164.          binding = new Binding(this,function():String
  165.          {
  166.             var _loc1_:* = undefined;
  167.             var _loc2_:* = undefined;
  168.             _loc1_ = labelTxt;
  169.             return _loc1_ == undefined ? null : String(_loc1_);
  170.          },function(param1:String):void
  171.          {
  172.             _Label1.text = param1;
  173.          },"_Label1.text");
  174.          _bindings[2] = binding;
  175.       }
  176.       
  177.       private function rollOutHandler(param1:Event) : void
  178.       {
  179.          this.highlight.visible = false;
  180.       }
  181.       
  182.       [Bindable(event="propertyChange")]
  183.       public function get highlight() : Image
  184.       {
  185.          return this._681210700highlight;
  186.       }
  187.       
  188.       [Bindable(event="propertyChange")]
  189.       public function get _Label1() : Label
  190.       {
  191.          return this._681920764_Label1;
  192.       }
  193.       
  194.       public function ___Canvas1_rollOver(param1:MouseEvent) : void
  195.       {
  196.          rollOverHandler(param1);
  197.       }
  198.       
  199.       public function set highlight(param1:Image) : void
  200.       {
  201.          var _loc2_:Object = null;
  202.          _loc2_ = this._681210700highlight;
  203.          if(_loc2_ !== param1)
  204.          {
  205.             this._681210700highlight = param1;
  206.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"highlight",_loc2_,param1));
  207.          }
  208.       }
  209.       
  210.       public function set labelTxt(param1:String) : void
  211.       {
  212.          var _loc2_:Object = null;
  213.          _loc2_ = this._1959266596labelTxt;
  214.          if(_loc2_ !== param1)
  215.          {
  216.             this._1959266596labelTxt = param1;
  217.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"labelTxt",_loc2_,param1));
  218.          }
  219.       }
  220.       
  221.       public function set _Label1(param1:Label) : void
  222.       {
  223.          var _loc2_:Object = null;
  224.          _loc2_ = this._681920764_Label1;
  225.          if(_loc2_ !== param1)
  226.          {
  227.             this._681920764_Label1 = param1;
  228.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_Label1",_loc2_,param1));
  229.          }
  230.       }
  231.       
  232.       private function _CoverThumb_bindingExprs() : void
  233.       {
  234.          var _loc1_:* = undefined;
  235.          _loc1_ = "images/thumbs/" + imgFile;
  236.          _loc1_ = btnDate;
  237.          _loc1_ = labelTxt;
  238.       }
  239.       
  240.       public function ___Canvas1_rollOut(param1:MouseEvent) : void
  241.       {
  242.          rollOutHandler(param1);
  243.       }
  244.       
  245.       [Bindable(event="propertyChange")]
  246.       public function get labelTxt() : String
  247.       {
  248.          return this._1959266596labelTxt;
  249.       }
  250.       
  251.       public function set _Image2(param1:Image) : void
  252.       {
  253.          var _loc2_:Object = null;
  254.          _loc2_ = this._607087478_Image2;
  255.          if(_loc2_ !== param1)
  256.          {
  257.             this._607087478_Image2 = param1;
  258.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_Image2",_loc2_,param1));
  259.          }
  260.       }
  261.       
  262.       private function rollOverHandler(param1:Event) : void
  263.       {
  264.          this.highlight.visible = true;
  265.       }
  266.       
  267.       [Bindable(event="propertyChange")]
  268.       public function get _Image2() : Image
  269.       {
  270.          return this._607087478_Image2;
  271.       }
  272.       
  273.       override public function initialize() : void
  274.       {
  275.          var target:CoverThumb = null;
  276.          var watcherSetupUtilClass:Object = null;
  277.          mx_internal::setDocumentDescriptor(_documentDescriptor_);
  278.          _CoverThumb_bindingsSetup();
  279.          target = this;
  280.          if(_watcherSetupUtil == null)
  281.          {
  282.             watcherSetupUtilClass = getDefinitionByName("_views_CoverThumbWatcherSetupUtil");
  283.             watcherSetupUtilClass["init"](null);
  284.          }
  285.          _watcherSetupUtil.setup(this,function(param1:String):*
  286.          {
  287.             return target[param1];
  288.          },_bindings,_watchers);
  289.          super.initialize();
  290.       }
  291.       
  292.       public function set imgFile(param1:String) : void
  293.       {
  294.          var _loc2_:Object = null;
  295.          _loc2_ = this._1916495839imgFile;
  296.          if(_loc2_ !== param1)
  297.          {
  298.             this._1916495839imgFile = param1;
  299.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"imgFile",_loc2_,param1));
  300.          }
  301.       }
  302.       
  303.       [Bindable(event="propertyChange")]
  304.       public function get imgFile() : String
  305.       {
  306.          return this._1916495839imgFile;
  307.       }
  308.    }
  309. }
  310.  
  311.